import request from '@/utils/request'

export const search = (data) => {
    return request({
        url: '/admin/registers/search',
        method: 'get',
        params: data
    })
}

export const getEmergContact = (data) => {
    return request({
        url: '/admin/registers/getEmergencyContact',
        method: 'get',
        params: data
    })
}

export const save = (data) => {
    return request({
        url: '/admin/registers/save',
        method: 'post',
        data
    })
}


export const updateInfo = (data) => {
    return request({
        url: '/admin/registers/update',
        method: 'post',
        data
    })
}

export const getListPage = (data) => {
    return request({
        url: '/admin/registers/getList',
        method: 'post',
        data
    })
}

export const getHistoryList = (data) => {
    return request({
        url: '/admin/registers/getList',
        method: 'post',
        data
    })
}

export const getPendListPage = (data) => {
    return request({
        url: '/admin/registers/getPendList',
        method: 'post',
        data
    })
}

export const exportData = (data) => {
    return request({
        url: '/admin/registers/export',
        method: 'get',
        params: data,
        responseType: 'blob', // 设置响应结果类型为blob类型
        headers: {
            Accept: '*/*'
        },
        
    })
}


export const deleteInfo = (data) => {
    return request({
        url: '/admin/registers/delete',
        method: 'post',
        params: data
    })
}


/**
 * <p>下载文件的方法
 * @returns {*}
 */
export function download() {
    return request({
        url: '/admin/registers/export',
        method: "GET",
        responseType: 'blob' //此处设置为blob
    })
}
